package jinbao.common;

import lombok.Data;

import java.io.Serial;
import java.io.Serializable;

/**
 * 封装返回结果
 */

@Data
public class Result implements Serializable {

    @Serial
    private static final long serialVersionUID = 918123865554541133L;
    /**
     * 状态码
     */
    private int code;

    /**
     * 执行结果
     */
    private boolean flag;

    /**
     * 返回结果信息，成功，报错等信息
     */
    private String message;
    /**
     * 数据
     */
    private Object data;


    public Result(int code, boolean flag, String message, Object data) {
        this.code = code;
        this.flag = flag;
        this.message = message;
        this.data = data;
    }


    public Result(int code, boolean flag, String message) {
        this.code = code;
        this.flag = flag;
        this.message = message;
        this.data = data;
    }
}
